<?php
require_once("config.php");
require_once("Info.php");
require_once("Database.php");
require_once("Message.php");

require_once("Smarty-2.6.18/libs/Smarty.class.php");

$smarty = new Smarty();


$temp = explode("/", $_SERVER['SCRIPT_NAME']);
$temp[count($temp)-1] = "";
$home = implode("/", $temp);
$smarty->assign("home", $home);

if(!empty($_POST['name']) && !empty($_POST['message'])) {
    Message::store($_POST['name'], $_POST['message']);
}

$messages = Message::getModel();
$smarty->assign("messages", $messages);
$smarty->display("about.tpl");
?>